package com.chpc.edeal.controller.impl;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.chpc.edeal.controller.AdminLoginController;
import com.chpc.edeal.vo.User;

@Controller
@RequestMapping(value="/admin")
public class AdminLoginControllerimpl implements AdminLoginController {
	
	@ModelAttribute("user")
	public User populateUser() {
		// TODO Auto-generated method stub
		return new User() ;
	}
	@RequestMapping(value="/login.htm",method=RequestMethod.GET)
	public String loginFormPopulator(Model m) {
		// TODO Auto-generated method stub
		return "admin/login";
	}
	@RequestMapping(value="/login.htm",method=RequestMethod.POST)
	public String loginFormHandler(@ModelAttribute("user")User u,BindingResult bind) {
		// TODO Auto-generated method stub
		return "admin/Home";
	}

	

}
